home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / VISUALBA / VCC.ZIP / FPROP.FRM < prev    next >
Text File  |  1994-02-01  |  3KB  |  112 lines

  1. VERSION 2.00
  2. Begin Form fProp 
  3.    Caption         =   "Proportional Resizing : Resize the form"
  4.    ClientHeight    =   3345
  5.    ClientLeft      =   1245
  6.    ClientTop       =   1605
  7.    ClientWidth     =   5100
  8.    Height          =   3810
  9.    Left            =   1155
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   3345
  12.    ScaleWidth      =   5100
  13.    Top             =   1230
  14.    Width           =   5280
  15.    Begin VideoSoftElastic VSElastic1 
  16.       Align           =   5  'Fill Container
  17.       AutoSizeChildren=   7  'Proportional
  18.       BackColor       =   &H00C0C0C0&
  19.       BevelInner      =   1  'Raised
  20.       BevelInnerWidth =   0
  21.       BevelOuter      =   1  'Raised
  22.       BevelOuterWidth =   1
  23.       Height          =   3345
  24.       Left            =   0
  25.       TabIndex        =   0
  26.       Top             =   0
  27.       Width           =   5100
  28.       Begin CheckBox Check1 
  29.          BackColor       =   &H00C0C0C0&
  30.          Caption         =   "Lock Font Size"
  31.          FontBold        =   -1  'True
  32.          FontItalic      =   0   'False
  33.          FontName        =   "Arial"
  34.          FontSize        =   12
  35.          FontStrikethru  =   0   'False
  36.          FontUnderline   =   0   'False
  37.          Height          =   615
  38.          Left            =   2310
  39.          TabIndex        =   3
  40.          Top             =   2550
  41.          Width           =   2445
  42.       End
  43.       Begin CommandButton Command1 
  44.          BackColor       =   &H00C0C0C0&
  45.          Caption         =   "&Help"
  46.          FontBold        =   -1  'True
  47.          FontItalic      =   0   'False
  48.          FontName        =   "Arial"
  49.          FontSize        =   12
  50.          FontStrikethru  =   0   'False
  51.          FontUnderline   =   0   'False
  52.          Height          =   555
  53.          Left            =   210
  54.          TabIndex        =   2
  55.          Top             =   2550
  56.          Width           =   1995
  57.       End
  58.       Begin TextBox Text1 
  59.          BackColor       =   &H00FFFFFF&
  60.          FontBold        =   -1  'True
  61.          FontItalic      =   0   'False
  62.          FontName        =   "Arial"
  63.          FontSize        =   12
  64.          FontStrikethru  =   0   'False
  65.          FontUnderline   =   0   'False
  66.          ForeColor       =   &H00FF0000&
  67.          Height          =   1725
  68.          Left            =   1845
  69.          MultiLine       =   -1  'True
  70.          ScrollBars      =   2  'Vertical
  71.          TabIndex        =   1
  72.          Text            =   "Proportional Resizing locks the controls in place at design time"
  73.          Top             =   405
  74.          Width           =   2895
  75.       End
  76.       Begin Image Image1 
  77.          Height          =   1095
  78.          Left            =   405
  79.          Picture         =   FPROP.FRX:0000
  80.          Stretch         =   -1  'True
  81.          Top             =   360
  82.          Width           =   1140
  83.       End
  84.    End
  85. End
  86. Option Explicit
  87.  
  88. Dim oh     'original height
  89.  
  90. Sub Command1_Click ()
  91.   MsgBox "This is done with only one elastic that fills the container and its AutoSizeChildren property set to proportional"
  92. End Sub
  93.  
  94. Sub Form_Load ()
  95.   oh = vselastic1.Height
  96. End Sub
  97.  
  98. Sub VSElastic1_ResizeChildren ()
  99.   'Code to Change fonts when form is resized
  100.   Dim I%
  101.   On Error Resume Next
  102.  
  103.   If check1.Value Then Exit Sub
  104.  
  105.   For I = 0 To Controls.Count - 1
  106.     Controls(I).FontSize = 12 * (vselastic1.Height / oh)
  107.     Controls(I).FontName = "Arial"
  108.   Next I
  109.  
  110. End Sub
  111.  
  112.